import { constantRoutes } from '@/router' // 导入静态路由
export default {
  namespaced: true,
  state: {
    // 先以静态路由作为菜单数据的初始值
    menuList: [...constantRoutes] // 保存当前用户可以访问的路由配置
  },
  // 修改状态
  mutations: {
    setMenuList(state, asyncRoutes) {
      // 将动态路由和静态路由组合起来
      state.menuList = [...constantRoutes, ...asyncRoutes]
    }
  }

}

